#include <stdlib.h>
#include <stdio.h>
#include <stdbool.h>
#include <pthread.h>
bool done = false;
void *T_loop(void * n) {
    bool volatile flag = true;
    while(!done);
}
void *T_setBool(void * n) {
    done = true;
}
int main(){
    pthread_t threads[2];
    pthread_create(&threads[0], NULL, T_loop, NULL);
    pthread_create(&threads[1], NULL, T_setBool, NULL);
    pthread_join(threads[0],NULL);
    pthread_join(threads[1],NULL);
    printf("main stop\n");
}